
package com.sjd.wx.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sjd.common.annotation.Excel;
import com.sjd.common.core.domain.BaseEntity;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 微信用户
 *
 * @author joker
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SjdMember extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Excel(name = "会员编号", cellType = Excel.ColumnType.NUMERIC, prompt = "会员编号")
    private Long memberId;
    /**
     * 手机号码
     */
    @Excel(name = "手机号码")
    private String phone;
    /**
     * 应用类型(1:小程序，2:公众号)
     */
    private String appType;
    /**
     * 用户标识
     */
    @JsonIgnore
    private String openId;
    /**
     * 昵称
     */
    @Excel(name = "昵称")
    private String nickName;
    /**
     * 头像
     */
    @Excel(name = "头像地址")
    private String headimgUrl;
    /**
     * union_id
     */
    @JsonIgnore
    private String unionId;
    /**
     * 会话密钥
     */
    @JsonIgnore
    private String sessionKey;
    /**
     * 备注信息
     */
    private String remark;
    @Excel(name = "会员等级")
    private Integer memberLevel;
    @Excel(name = "金豆数量")
    private Long goldenNum;
    @Excel(name = "积分数量")
    private Long integral;
    @Excel(name = "族群")
    private String belongGroup;
    public Map<String,Object> toMap(String thirdSessionKey){
        Map<String,Object> map = new HashMap<>(4);
        map.put("sessionKey",thirdSessionKey);
        map.put("nickName", this.getNickName());
        map.put("phone", this.getPhone());
        map.put("openId", this.getOpenId());
        return map;
    }
}
